package com.mcc.app.carbonEmission.controller;

import java.util.Date;
import java.util.List;
import com.mcc.common.utils.SecurityUtils;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.mcc.common.annotation.Log;
import com.mcc.common.core.controller.BaseController;
import com.mcc.common.core.domain.AjaxResult;
import com.mcc.common.enums.BusinessType;
import com.mcc.app.carbonEmission.domain.ReportAssistHan;
import com.mcc.app.carbonEmission.service.IReportAssistHanService;
import com.mcc.common.core.page.TableDataInfo;

/**
 * 过热蒸汽焓值
 *
 * @author gxy
 * @date 2025-07-04
 */
@Api(tags = "过热蒸汽焓值")
@RestController
@RequestMapping("/carbonEmission/han")
public class ReportAssistHanController extends BaseController {

    @Autowired
    private IReportAssistHanService reportAssistHanService;

    @ApiOperation("查询过热蒸汽焓值列表")
    @ApiOperationSupport(order = 1)
    @PreAuthorize("@ss.hasPermi('carbonEmission:han:list')")
    @GetMapping("/list")
    public AjaxResult<TableDataInfo<ReportAssistHan>> list(ReportAssistHan reportAssistHan) {
        List<ReportAssistHan> list = reportAssistHanService.selectReportAssistHanList(reportAssistHan);
        return getDataTable(list);
    }

    @ApiOperation("查询过热蒸汽焓值列表(分页)")
    @ApiOperationSupport(order = 2)
    @PreAuthorize("@ss.hasPermi('carbonEmission:han:list')")
    @GetMapping("/page")
    public AjaxResult<TableDataInfo<ReportAssistHan>> page(ReportAssistHan reportAssistHan) {
        startPage();
        List<ReportAssistHan> list = reportAssistHanService.selectReportAssistHanList(reportAssistHan);
        return getDataTable(list);
    }

    @ApiOperation("获取过热蒸汽焓值详细信息")
    @ApiOperationSupport(order = 3)
    @PreAuthorize("@ss.hasPermi('carbonEmission:han:query')")
    @GetMapping("/get/{id}")
    public AjaxResult<ReportAssistHan> getInfo(@PathVariable("id") Long id) {
        return AjaxResult.success(reportAssistHanService.selectReportAssistHanById(id));
    }

    @ApiOperation("新增过热蒸汽焓值")
    @ApiOperationSupport(order = 4)
    @PreAuthorize("@ss.hasPermi('carbonEmission:han:add')")
    @Log(title = "过热蒸汽焓值", businessType = BusinessType.INSERT)
    @PostMapping("/add")
    public AjaxResult add(@RequestBody ReportAssistHan reportAssistHan) {
        return toAjax(reportAssistHanService.insertReportAssistHan(reportAssistHan));
    }

    @ApiOperation("修改过热蒸汽焓值")
    @ApiOperationSupport(order = 5)
    @PreAuthorize("@ss.hasPermi('carbonEmission:han:edit')")
    @Log(title = "过热蒸汽焓值", businessType = BusinessType.UPDATE)
    @PostMapping("/edit")
    public AjaxResult edit(@RequestBody ReportAssistHan reportAssistHan) {
        return toAjax(reportAssistHanService.updateReportAssistHan(reportAssistHan));
    }

    @ApiOperation("删除过热蒸汽焓值")
    @ApiOperationSupport(order = 6)
    @PreAuthorize("@ss.hasPermi('carbonEmission:han:remove')")
    @Log(title = "过热蒸汽焓值", businessType = BusinessType.DELETE)
	@PostMapping("/remove/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids) {
        return toAjax(reportAssistHanService.deleteReportAssistHanByIds(ids));
    }
}
